Fix lazy If branch pruning and skipped-parent handling in graph runtime#9079
Fix lazy If branch pruning and skipped-parent handling in graph runtime#9079JPPhoto wants to merge 3 commits intoinvoke-ai:mainfrom
Conversation
63e5b16 to
f681759
Compare
f681759 to
3785efb
Compare
|
Findings Low: Low: Low: Low: Open Questions The new fallback in _prepare_if_inputs (
I had the problem that the UI didn't know that the graph had finished rendering. But I saw that you already addressed this in another PR? |
I addressed these review concerns with tests first. The selected-branch missing-result path now fails loudly instead of silently propagating Tests added/updated in tests/test_graph_execution_state.py cover:
The concern about silent
My plan:
Why I think that is the right course:
So the mutation is real, but the impact appears limited to inspection/debug snapshots of failed/completed sessions, not runtime behavior or retry semantics. If you know of any real consumers of the execution graph, then I can separate
Correct! |
Optional Hardening Notes (non-blocking)These are nice-to-haves on top of an already solid PR — none are defects, just polish. 1. Document idempotency of
|
|
@Pfannkuchensack I finished the cleanup pass. In invokeai/app/services/shared/graph.py, I also tightened the tests in tests/test_graph_execution_state.py: the missing-result |
Summary
Fixes lazy If execution in
invokeai/app/services/shared/graph.pyfor workflows where a selected branch shares ancestors with the unselected branch.The runtime bug was that resolving an
Ifnode decremented indegree for the pruned input but left the pruned execution edge in place, so later parent completion could decrement the same dependency again. This could make theIfnode become ready too early, underflow indegree, or propagateNoneinto required downstream inputs.This PR:
Ifinput edges from the execution graph during branch resolutionIfinput hydrationinvokeai/app/services/shared/README.mdto document the runtime behaviorRelated Issues / Discussions
Complex workflow failure involving a single
Ifnode feedingpositive_text_conditioningonflux_denoise.QA Instructions
Load a workflow where
collect -> if -> required downstream inputis used and verify:KeyError, indegree underflow, or missing required-connection error occurs from theIfruntime pathMerge Plan
Checklist
What's Newcopy (if doing a release after this PR)